package com.itheima.apidemo;

import java.math.BigDecimal;

/*
BigDecimal
 */
public class Demo07 {

    public static void main(String[] args) {
        BigDecimal bd1 = new BigDecimal("20.0");
        BigDecimal bd2 = new BigDecimal("3.0");
        System.out.println(bd1.add(bd2));
        System.out.println(bd1.subtract(bd2));
        System.out.println(bd1.multiply(bd2));
       // System.out.println(bd1.divide(bd2));
        System.out.println(bd1.divide(bd2, 8, BigDecimal.ROUND_UP));
        System.out.println(bd1.divide(bd2, 2, BigDecimal.ROUND_FLOOR));
        System.out.println(bd1.divide(bd2, 6, BigDecimal.ROUND_HALF_UP));



    }
}
